<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2">
<meta name="theme-color" content="#222">
<meta name="generator" content="Hexo 5.1.1">
  <link rel="apple-touch-icon" sizes="180x180" href="/hexo/images/apple-touch-icon-next.png">
  <link rel="icon" type="image/png" sizes="32x32" href="/hexo/images/favicon-32x32-next.png">
  <link rel="icon" type="image/png" sizes="16x16" href="/hexo/images/favicon-16x16-next.png">
  <link rel="mask-icon" href="/hexo/images/logo.svg" color="#222">

<link rel="stylesheet" href="/hexo/css/main.css">


<link rel="stylesheet" href="/hexo/lib/font-awesome/css/all.min.css">

<script id="hexo-configurations">
    var NexT = window.NexT || {};
    var CONFIG = {"hostname":"youchen12138.gitee.io","root":"/hexo/","scheme":"Gemini","version":"7.8.0","exturl":false,"sidebar":{"position":"left","display":"post","padding":18,"offset":12,"onmobile":false},"copycode":{"enable":false,"show_result":false,"style":null},"back2top":{"enable":true,"sidebar":false,"scrollpercent":false},"bookmark":{"enable":false,"color":"#222","save":"auto"},"fancybox":false,"mediumzoom":false,"lazyload":false,"pangu":false,"comments":{"style":"tabs","active":null,"storage":true,"lazyload":false,"nav":null},"algolia":{"hits":{"per_page":10},"labels":{"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}},"localsearch":{"enable":false,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":false},"motion":{"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}}};
  </script>

  <meta name="description" content="什么是 bootstrap bootstrap 是 Twitter 公司开发基于 HTML、CSS、JavaScript 的前端框架  为实现 web 应用程序快速开发提供的一套前端工具包  响应式布局  移动设备优先   bootstrap 的特性 响应式设计  栅格布局  完整的类库  jQuery 插件   bootstrap 全局样式的特点 代码整洁  风格统一  美观易用   boots">
<meta property="og:type" content="article">
<meta property="og:title" content="bootstrap入门之全局样式">
<meta property="og:url" content="https://youchen12138.gitee.io/hexo/2020/08/26/bootstrap%E5%85%A5%E9%97%A8%E4%B9%8B%E5%85%A8%E5%B1%80%E6%A0%B7%E5%BC%8F/index.html">
<meta property="og:site_name" content="幽辰的博客">
<meta property="og:description" content="什么是 bootstrap bootstrap 是 Twitter 公司开发基于 HTML、CSS、JavaScript 的前端框架  为实现 web 应用程序快速开发提供的一套前端工具包  响应式布局  移动设备优先   bootstrap 的特性 响应式设计  栅格布局  完整的类库  jQuery 插件   bootstrap 全局样式的特点 代码整洁  风格统一  美观易用   boots">
<meta property="og:locale" content="en_US">
<meta property="article:published_time" content="2020-08-25T16:03:36.000Z">
<meta property="article:modified_time" content="2020-08-25T16:03:54.983Z">
<meta property="article:author" content="幽辰">
<meta property="article:tag" content="bootstrap">
<meta name="twitter:card" content="summary">

<link rel="canonical" href="https://youchen12138.gitee.io/hexo/2020/08/26/bootstrap%E5%85%A5%E9%97%A8%E4%B9%8B%E5%85%A8%E5%B1%80%E6%A0%B7%E5%BC%8F/">


<script id="page-configurations">
  // https://hexo.io/docs/variables.html
  CONFIG.page = {
    sidebar: "",
    isHome : false,
    isPost : true,
    lang   : 'en'
  };
</script>

  <title>bootstrap入门之全局样式 | 幽辰的博客</title>
  






  <noscript>
  <style>
  .use-motion .brand,
  .use-motion .menu-item,
  .sidebar-inner,
  .use-motion .post-block,
  .use-motion .pagination,
  .use-motion .comments,
  .use-motion .post-header,
  .use-motion .post-body,
  .use-motion .collection-header { opacity: initial; }

  .use-motion .site-title,
  .use-motion .site-subtitle {
    opacity: initial;
    top: initial;
  }

  .use-motion .logo-line-before i { left: initial; }
  .use-motion .logo-line-after i { right: initial; }
  </style>
</noscript>

</head>

<body itemscope itemtype="http://schema.org/WebPage">
  <div class="container use-motion">
    <div class="headband"></div>

    <header class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-container">
  <div class="site-nav-toggle">
    <div class="toggle" aria-label="Toggle navigation bar">
      <span class="toggle-line toggle-line-first"></span>
      <span class="toggle-line toggle-line-middle"></span>
      <span class="toggle-line toggle-line-last"></span>
    </div>
  </div>

  <div class="site-meta">

    <a href="/hexo/" class="brand" rel="start">
      <span class="logo-line-before"><i></i></span>
      <h1 class="site-title">幽辰的博客</h1>
      <span class="logo-line-after"><i></i></span>
    </a>
  </div>

  <div class="site-nav-right">
    <div class="toggle popup-trigger">
    </div>
  </div>
</div>




<nav class="site-nav">
  <ul id="menu" class="main-menu menu">
        <li class="menu-item menu-item-home">

    <a href="/hexo/" rel="section"><i class="fa fa-home fa-fw"></i>Home</a>

  </li>
        <li class="menu-item menu-item-tags">

    <a href="/hexo/tags/" rel="section"><i class="fa fa-tags fa-fw"></i>Tags<span class="badge">23</span></a>

  </li>
        <li class="menu-item menu-item-categories">

    <a href="/hexo/categories/" rel="section"><i class="fa fa-th fa-fw"></i>Categories<span class="badge">14</span></a>

  </li>
        <li class="menu-item menu-item-archives">

    <a href="/hexo/archives/" rel="section"><i class="fa fa-archive fa-fw"></i>Archives<span class="badge">127</span></a>

  </li>
  </ul>
</nav>




</div>
    </header>

    
  <div class="back-to-top">
    <i class="fa fa-arrow-up"></i>
    <span>0%</span>
  </div>


    <main class="main">
      <div class="main-inner">
        <div class="content-wrap">
          

          <div class="content post posts-expand">
            

    
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block" lang="en">
    <link itemprop="mainEntityOfPage" href="https://youchen12138.gitee.io/hexo/2020/08/26/bootstrap%E5%85%A5%E9%97%A8%E4%B9%8B%E5%85%A8%E5%B1%80%E6%A0%B7%E5%BC%8F/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/hexo/images/avatar.jpg">
      <meta itemprop="name" content="幽辰">
      <meta itemprop="description" content="">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="幽辰的博客">
    </span>
      <header class="post-header">
        <h1 class="post-title" itemprop="name headline">
          bootstrap入门之全局样式
        </h1>

        <div class="post-meta">
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-calendar"></i>
              </span>
              <span class="post-meta-item-text">Posted on</span>
              

              <time title="Created: 2020-08-26 00:03:36 / Modified: 00:03:54" itemprop="dateCreated datePublished" datetime="2020-08-26T00:03:36+08:00">2020-08-26</time>
            </span>
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-folder"></i>
              </span>
              <span class="post-meta-item-text">In</span>
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/hexo/categories/bootstrap/" itemprop="url" rel="index"><span itemprop="name">bootstrap</span></a>
                </span>
            </span>

          

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
        <h2 id="什么是-bootstrap"><a href="#什么是-bootstrap" class="headerlink" title="什么是 bootstrap"></a>什么是 bootstrap</h2><ul>
<li><p>bootstrap 是 Twitter 公司开发基于 HTML、CSS、JavaScript 的前端框架</p>
</li>
<li><p>为实现 web 应用程序快速开发提供的一套前端工具包</p>
</li>
<li><p>响应式布局</p>
</li>
<li><p>移动设备优先</p>
</li>
</ul>
<h2 id="bootstrap-的特性"><a href="#bootstrap-的特性" class="headerlink" title="bootstrap 的特性"></a>bootstrap 的特性</h2><ul>
<li><p>响应式设计</p>
</li>
<li><p>栅格布局</p>
</li>
<li><p>完整的类库</p>
</li>
<li><p>jQuery 插件</p>
</li>
</ul>
<h2 id="bootstrap-全局样式的特点"><a href="#bootstrap-全局样式的特点" class="headerlink" title="bootstrap 全局样式的特点"></a>bootstrap 全局样式的特点</h2><ul>
<li><p>代码整洁</p>
</li>
<li><p>风格统一</p>
</li>
<li><p>美观易用</p>
</li>
</ul>
<p>bootstrap 提供了大量的全局样式，基本的 HTML 元素均可以通过 class 设置样式并得到增强效果</p>
<h2 id="bootstrap-中的排版"><a href="#bootstrap-中的排版" class="headerlink" title="bootstrap 中的排版"></a>bootstrap 中的排版</h2><p>bootstrap 对默认的排版方式进行了 CSS 样式定义，使得各种基本结构套用出来的 HTML 页面更加美观</p>
<h3 id="标题"><a href="#标题" class="headerlink" title="标题"></a>标题</h3><ul>
<li><p>标题（h1 ~ h6 / .h1 ~ .h6）</p>
<table>
<thead>
<tr>
<th>标题</th>
<th>字体大小</th>
</tr>
</thead>
<tbody><tr>
<td>h1</td>
<td>36px</td>
</tr>
<tr>
<td>h2</td>
<td>30px</td>
</tr>
<tr>
<td>h3</td>
<td>24px</td>
</tr>
<tr>
<td>h4</td>
<td>18px</td>
</tr>
<tr>
<td>h5</td>
<td>14px</td>
</tr>
<tr>
<td>h6</td>
<td>12px</td>
</tr>
</tbody></table>
</li>
<li><p>副标题（small）</p>
</li>
</ul>
<h3 id="文本"><a href="#文本" class="headerlink" title="文本"></a>文本</h3><ul>
<li>段落</li>
</ul>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">p 标签</span><br><span class="line"></span><br><span class="line">默认：14px</span><br><span class="line">行高：20px</span><br><span class="line">底部外边距：10px</span><br></pre></td></tr></table></figure>

<ul>
<li>强调</li>
</ul>
<blockquote>
<p><code>&lt;mark&gt;&lt;/mark&gt;</code></p>
</blockquote>
<ul>
<li>删除</li>
</ul>
<blockquote>
<p><code>&lt;del&gt;&lt;/del&gt;</code></p>
</blockquote>
<ul>
<li>下划线</li>
</ul>
<blockquote>
<p><code>&lt;ins&gt;&lt;/ins&gt;</code></p>
</blockquote>
<ul>
<li>文本标记</li>
</ul>
<h3 id="对齐"><a href="#对齐" class="headerlink" title="对齐"></a>对齐</h3><ul>
<li><p><code>.text-left</code></p>
</li>
<li><p><code>.text-center</code></p>
</li>
<li><p><code>.text-right</code></p>
</li>
</ul>
<h3 id="大小写"><a href="#大小写" class="headerlink" title="大小写"></a>大小写</h3><ul>
<li><p><code>.text-lowercase</code></p>
</li>
<li><p><code>.text-uppercase</code></p>
</li>
<li><p><code>.text-capitalize</code></p>
</li>
</ul>
<h2 id="表格"><a href="#表格" class="headerlink" title="表格"></a>表格</h2><ul>
<li><p>带边框的表格：<code>.table-bordered</code></p>
</li>
<li><p>条纹状表格：<code>.table-striped</code></p>
</li>
<li><p>悬停变色：<code>table-hover</code></p>
</li>
<li><p>紧凑风格：<code>.table-condensed</code></p>
</li>
</ul>
<h3 id="表格样式"><a href="#表格样式" class="headerlink" title="表格样式"></a>表格样式</h3><table>
<thead>
<tr>
<th>表格</th>
<th>描述</th>
</tr>
</thead>
<tbody><tr>
<td><code>.table-primary</code></td>
<td>蓝色: 指定这是一个重要的操作</td>
</tr>
<tr>
<td><code>.table-success</code></td>
<td>绿色: 指定这是一个允许执行的操作</td>
</tr>
<tr>
<td><code>.table-danger</code></td>
<td>红色: 指定这是可以危险的操作</td>
</tr>
<tr>
<td><code>.table-info</code></td>
<td>浅蓝色: 表示内容已变更</td>
</tr>
<tr>
<td><code>.table-warning</code></td>
<td>橘色: 表示需要注意的操作</td>
</tr>
<tr>
<td><code>.table-active</code></td>
<td>灰色: 用于鼠标悬停效果</td>
</tr>
<tr>
<td><code>.table-secondary</code></td>
<td>灰色: 表示内容不怎么重要</td>
</tr>
<tr>
<td><code>.table-light</code></td>
<td>浅灰色，可以是表格行的背景</td>
</tr>
<tr>
<td><code>.table-dark</code></td>
<td>深灰色，可以是表格行的背景</td>
</tr>
</tbody></table>
<h2 id="表单"><a href="#表单" class="headerlink" title="表单"></a>表单</h2><p>bootstrap 给 HTML 大部分表单都设置了默认样式，我们可以给表单添加相应类名，以实现表单的水平排列，个性化定制等</p>
<p>bootstrap 提供了下列类型的表单布局：</p>
<ul>
<li><p>垂直表单（默认）</p>
</li>
<li><p>内联表单</p>
</li>
<li><p>水平表单</p>
</li>
</ul>
<h3 id="基本表单（垂直表单）"><a href="#基本表单（垂直表单）" class="headerlink" title="基本表单（垂直表单）"></a>基本表单（垂直表单）</h3><p>创建基本表单的步骤：</p>
<ol>
<li><p>向父 <code>&lt;form&gt;</code> 元素添加 <code>role=&quot;form&quot;</code>。</p>
</li>
<li><p>把标签和控件放在一个带有 <code>class .form-group</code> 的 <code>&lt;div&gt;</code> 中。这是获取最佳间距所必需的。</p>
</li>
<li><p>向所有的文本元素 <code>&lt;input&gt;</code>、<code>&lt;textarea&gt;</code> 和 <code>&lt;select&gt;</code> 添加 <code>class =&quot;form-control&quot;</code> 。</p>
</li>
</ol>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br></pre></td><td class="code"><pre><span class="line">&lt;form role&#x3D;&quot;form&quot;&gt;</span><br><span class="line">&lt;div class&#x3D;&quot;form-group&quot;&gt;</span><br><span class="line">    &lt;label for&#x3D;&quot;name&quot;&gt;名称&lt;&#x2F;label&gt;</span><br><span class="line">    &lt;input type&#x3D;&quot;text&quot; class&#x3D;&quot;form-control&quot; id&#x3D;&quot;name&quot; placeholder&#x3D;&quot;请输入名称&quot;&gt;</span><br><span class="line">&lt;&#x2F;div&gt;</span><br><span class="line">&lt;div class&#x3D;&quot;form-group&quot;&gt;</span><br><span class="line">    &lt;label for&#x3D;&quot;inputfile&quot;&gt;文件输入&lt;&#x2F;label&gt;</span><br><span class="line">    &lt;input type&#x3D;&quot;file&quot; id&#x3D;&quot;inputfile&quot;&gt;</span><br><span class="line">    &lt;p class&#x3D;&quot;help-block&quot;&gt;这里是块级帮助文本的实例。&lt;&#x2F;p&gt;</span><br><span class="line">&lt;&#x2F;div&gt;</span><br><span class="line">&lt;div class&#x3D;&quot;checkbox&quot;&gt;</span><br><span class="line">    &lt;label&gt;</span><br><span class="line">    &lt;input type&#x3D;&quot;checkbox&quot;&gt;请打勾</span><br><span class="line">    &lt;&#x2F;label&gt;</span><br><span class="line">&lt;&#x2F;div&gt;</span><br><span class="line">&lt;button type&#x3D;&quot;submit&quot; class&#x3D;&quot;btn btn-default&quot;&gt;提交&lt;&#x2F;button&gt;</span><br><span class="line">&lt;&#x2F;form&gt;</span><br></pre></td></tr></table></figure>

<h3 id="内联表单"><a href="#内联表单" class="headerlink" title="内联表单"></a>内联表单</h3><p>如果需要创建一个表单，它的所有元素是内联的，向左对齐的，标签是并排的，请向 <code>&lt;form&gt;</code> 标签添加 <code>class .form-inline</code></p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br></pre></td><td class="code"><pre><span class="line">&lt;form class&#x3D;&quot;form-inline&quot; role&#x3D;&quot;form&quot;&gt;</span><br><span class="line">    &lt;div class&#x3D;&quot;form-group&quot;&gt;</span><br><span class="line">        &lt;label class&#x3D;&quot;sr-only&quot; for&#x3D;&quot;name&quot;&gt;名称&lt;&#x2F;label&gt;</span><br><span class="line">        &lt;input type&#x3D;&quot;text&quot; class&#x3D;&quot;form-control&quot; id&#x3D;&quot;name&quot; placeholder&#x3D;&quot;请输入名称&quot;&gt;</span><br><span class="line">    &lt;&#x2F;div&gt;</span><br><span class="line">    &lt;div class&#x3D;&quot;form-group&quot;&gt;</span><br><span class="line">        &lt;label class&#x3D;&quot;sr-only&quot; for&#x3D;&quot;inputfile&quot;&gt;文件输入&lt;&#x2F;label&gt;</span><br><span class="line">        &lt;input type&#x3D;&quot;file&quot; id&#x3D;&quot;inputfile&quot;&gt;</span><br><span class="line">    &lt;&#x2F;div&gt;</span><br><span class="line">    &lt;div class&#x3D;&quot;checkbox&quot;&gt;</span><br><span class="line">        &lt;label&gt;</span><br><span class="line">        &lt;input type&#x3D;&quot;checkbox&quot;&gt;请打勾</span><br><span class="line">        &lt;&#x2F;label&gt;</span><br><span class="line">    &lt;&#x2F;div&gt;</span><br><span class="line">    &lt;button type&#x3D;&quot;submit&quot; class&#x3D;&quot;btn btn-default&quot;&gt;提交&lt;&#x2F;button&gt;</span><br><span class="line">&lt;&#x2F;form&gt;</span><br></pre></td></tr></table></figure>

<h4 id="注意"><a href="#注意" class="headerlink" title="注意"></a>注意</h4><ul>
<li><p>默认情况下，Bootstrap 中的 <code>input``、select</code> 和 <code>textarea</code> 有 100% 宽度。在使用内联表单时，您需要在表单控件上设置一个宽度。</p>
</li>
<li><p>使用 <code>class .sr-only</code>，您可以隐藏内联表单的标签。</p>
</li>
</ul>
<h3 id="水平表单"><a href="#水平表单" class="headerlink" title="水平表单"></a>水平表单</h3><p>水平表单与其他表单不仅标记的数量上不同，而且表单的呈现形式也不同。如需创建一个水平布局的表单，请按下面的几个步骤进行：</p>
<ol>
<li><p>向父 <code>&lt;form&gt;</code> 元素添加 <code>class .form-horizontal</code></p>
</li>
<li><p>把标签和控件放在一个带有 <code>class .form-group</code> 的 <code>&lt;div&gt;</code> 中</p>
</li>
<li><p>向标签添加 <code>class .control-label</code></p>
</li>
</ol>
<p>实例</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br></pre></td><td class="code"><pre><span class="line">&lt;form class&#x3D;&quot;form-horizontal&quot; role&#x3D;&quot;form&quot;&gt;</span><br><span class="line">    &lt;div class&#x3D;&quot;form-group&quot;&gt;</span><br><span class="line">        &lt;label for&#x3D;&quot;firstname&quot; class&#x3D;&quot;col-sm-2 control-label&quot;&gt;名字&lt;&#x2F;label&gt;</span><br><span class="line">        &lt;div class&#x3D;&quot;col-sm-10&quot;&gt;</span><br><span class="line">        &lt;input type&#x3D;&quot;text&quot; class&#x3D;&quot;form-control&quot; id&#x3D;&quot;firstname&quot; placeholder&#x3D;&quot;请输入名字&quot;&gt;</span><br><span class="line">        &lt;&#x2F;div&gt;</span><br><span class="line">    &lt;&#x2F;div&gt;</span><br><span class="line">    &lt;div class&#x3D;&quot;form-group&quot;&gt;</span><br><span class="line">        &lt;label for&#x3D;&quot;lastname&quot; class&#x3D;&quot;col-sm-2 control-label&quot;&gt;姓&lt;&#x2F;label&gt;</span><br><span class="line">        &lt;div class&#x3D;&quot;col-sm-10&quot;&gt;</span><br><span class="line">        &lt;input type&#x3D;&quot;text&quot; class&#x3D;&quot;form-control&quot; id&#x3D;&quot;lastname&quot; placeholder&#x3D;&quot;请输入姓&quot;&gt;</span><br><span class="line">        &lt;&#x2F;div&gt;</span><br><span class="line">    &lt;&#x2F;div&gt;</span><br><span class="line">    &lt;div class&#x3D;&quot;form-group&quot;&gt;</span><br><span class="line">        &lt;div class&#x3D;&quot;col-sm-offset-2 col-sm-10&quot;&gt;</span><br><span class="line">        &lt;div class&#x3D;&quot;checkbox&quot;&gt;</span><br><span class="line">            &lt;label&gt;</span><br><span class="line">            &lt;input type&#x3D;&quot;checkbox&quot;&gt;请记住我</span><br><span class="line">            &lt;&#x2F;label&gt;</span><br><span class="line">        &lt;&#x2F;div&gt;</span><br><span class="line">        &lt;&#x2F;div&gt;</span><br><span class="line">    &lt;&#x2F;div&gt;</span><br><span class="line">    &lt;div class&#x3D;&quot;form-group&quot;&gt;</span><br><span class="line">        &lt;div class&#x3D;&quot;col-sm-offset-2 col-sm-10&quot;&gt;</span><br><span class="line">        &lt;button type&#x3D;&quot;submit&quot; class&#x3D;&quot;btn btn-default&quot;&gt;登录&lt;&#x2F;button&gt;</span><br><span class="line">        &lt;&#x2F;div&gt;</span><br><span class="line">    &lt;&#x2F;div&gt;</span><br><span class="line">&lt;&#x2F;form&gt;</span><br></pre></td></tr></table></figure>

<h3 id="输入框"><a href="#输入框" class="headerlink" title="输入框"></a>输入框</h3><p>向 <code>input</code> 输入框添加以下类名可产生相应变化</p>
<table>
<thead>
<tr>
<th>类名</th>
<th>描述</th>
</tr>
</thead>
<tbody><tr>
<td><code>.input-lg</code></td>
<td>输入框变大</td>
</tr>
<tr>
<td><code>.input-sm</code></td>
<td>输入框变小</td>
</tr>
</tbody></table>
<h3 id="标签"><a href="#标签" class="headerlink" title="标签"></a>标签</h3><p>向 <code>label</code> 标签添加以下类名可产生相应变化</p>
<table>
<thead>
<tr>
<th>类名</th>
<th>描述</th>
</tr>
</thead>
<tbody><tr>
<td><code>.sr-only</code></td>
<td>该标签隐藏</td>
</tr>
<tr>
<td><code>.control-label</code></td>
<td>如果上一级包含<code>.form-group</code>的<code>div</code>标签中有类似于<code>.has-success</code>的类名，改变该标签的状态</td>
</tr>
</tbody></table>
<h3 id="按钮"><a href="#按钮" class="headerlink" title="按钮"></a>按钮</h3><p>向 <code>button</code> 标签添加以下类名可产生相应变化</p>
<p>并不局限于 <code>button</code> 标签，比如也可以在 <code>a</code> 标签中设置</p>
<table>
<thead>
<tr>
<th>类名</th>
<th>描述</th>
</tr>
</thead>
<tbody><tr>
<td><code>.btn</code></td>
<td>按钮变为圆角</td>
</tr>
<tr>
<td><code>.btn-default</code></td>
<td>鼠标移入、访问会有不同效果</td>
</tr>
<tr>
<td><code>.btn-success</code></td>
<td>改变颜色。绿色</td>
</tr>
<tr>
<td><code>.btn-lg</code></td>
<td>按钮变大</td>
</tr>
<tr>
<td><code>.btn-sm</code></td>
<td>按钮变小</td>
</tr>
<tr>
<td><code>.btn-block</code></td>
<td>按钮长度和屏幕一样长</td>
</tr>
</tbody></table>
<h2 id="图片"><a href="#图片" class="headerlink" title="图片"></a>图片</h2><table>
<thead>
<tr>
<th>类名</th>
<th>描述</th>
</tr>
</thead>
<tbody><tr>
<td><code>.img-rounded</code></td>
<td>圆角</td>
</tr>
<tr>
<td><code>.img-circle</code></td>
<td>圆形</td>
</tr>
<tr>
<td><code>.img-thumbnail</code></td>
<td>带有边框的圆角图形</td>
</tr>
<tr>
<td><code>.img-responsive</code></td>
<td>图片响应式 (将很好地扩展到父元素)</td>
</tr>
</tbody></table>
<h2 id="辅助类"><a href="#辅助类" class="headerlink" title="辅助类"></a>辅助类</h2><p><a target="_blank" rel="noopener" href="https://www.runoob.com/bootstrap/bootstrap-helper-classes.html">请转至此链接查看</a></p>

    </div>

    
    
    

      <footer class="post-footer">
          <div class="post-tags">
              <a href="/hexo/tags/bootstrap/" rel="tag"># bootstrap</a>
          </div>

        


        
    <div class="post-nav">
      <div class="post-nav-item">
    <a href="/hexo/2020/08/26/bootstrap%E7%BB%84%E4%BB%B6/" rel="prev" title="bootstrap组件">
      <i class="fa fa-chevron-left"></i> bootstrap组件
    </a></div>
      <div class="post-nav-item">
    <a href="/hexo/2020/08/26/CSS%E8%BF%9B%E9%98%B6%E7%9F%A5%E8%AF%86%E7%82%B9-%E5%8A%A8%E7%94%BB%E5%8F%8A%E5%85%B3%E9%94%AE%E5%B8%A7/" rel="next" title="CSS进阶知识点--动画及关键帧">
      CSS进阶知识点--动画及关键帧 <i class="fa fa-chevron-right"></i>
    </a></div>
    </div>
      </footer>
    
  </article>
  
  
  



          </div>
          

<script>
  window.addEventListener('tabs:register', () => {
    let { activeClass } = CONFIG.comments;
    if (CONFIG.comments.storage) {
      activeClass = localStorage.getItem('comments_active') || activeClass;
    }
    if (activeClass) {
      let activeTab = document.querySelector(`a[href="#comment-${activeClass}"]`);
      if (activeTab) {
        activeTab.click();
      }
    }
  });
  if (CONFIG.comments.storage) {
    window.addEventListener('tabs:click', event => {
      if (!event.target.matches('.tabs-comment .tab-content .tab-pane')) return;
      let commentClass = event.target.classList[1];
      localStorage.setItem('comments_active', commentClass);
    });
  }
</script>

        </div>
          
  
  <div class="toggle sidebar-toggle">
    <span class="toggle-line toggle-line-first"></span>
    <span class="toggle-line toggle-line-middle"></span>
    <span class="toggle-line toggle-line-last"></span>
  </div>

  <aside class="sidebar">
    <div class="sidebar-inner">

      <ul class="sidebar-nav motion-element">
        <li class="sidebar-nav-toc">
          Table of Contents
        </li>
        <li class="sidebar-nav-overview">
          Overview
        </li>
      </ul>

      <!--noindex-->
      <div class="post-toc-wrap sidebar-panel">
          <div class="post-toc motion-element"><ol class="nav"><li class="nav-item nav-level-2"><a class="nav-link" href="#%E4%BB%80%E4%B9%88%E6%98%AF-bootstrap"><span class="nav-number">1.</span> <span class="nav-text">什么是 bootstrap</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#bootstrap-%E7%9A%84%E7%89%B9%E6%80%A7"><span class="nav-number">2.</span> <span class="nav-text">bootstrap 的特性</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#bootstrap-%E5%85%A8%E5%B1%80%E6%A0%B7%E5%BC%8F%E7%9A%84%E7%89%B9%E7%82%B9"><span class="nav-number">3.</span> <span class="nav-text">bootstrap 全局样式的特点</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#bootstrap-%E4%B8%AD%E7%9A%84%E6%8E%92%E7%89%88"><span class="nav-number">4.</span> <span class="nav-text">bootstrap 中的排版</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#%E6%A0%87%E9%A2%98"><span class="nav-number">4.1.</span> <span class="nav-text">标题</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E6%96%87%E6%9C%AC"><span class="nav-number">4.2.</span> <span class="nav-text">文本</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E5%AF%B9%E9%BD%90"><span class="nav-number">4.3.</span> <span class="nav-text">对齐</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E5%A4%A7%E5%B0%8F%E5%86%99"><span class="nav-number">4.4.</span> <span class="nav-text">大小写</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#%E8%A1%A8%E6%A0%BC"><span class="nav-number">5.</span> <span class="nav-text">表格</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#%E8%A1%A8%E6%A0%BC%E6%A0%B7%E5%BC%8F"><span class="nav-number">5.1.</span> <span class="nav-text">表格样式</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#%E8%A1%A8%E5%8D%95"><span class="nav-number">6.</span> <span class="nav-text">表单</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#%E5%9F%BA%E6%9C%AC%E8%A1%A8%E5%8D%95%EF%BC%88%E5%9E%82%E7%9B%B4%E8%A1%A8%E5%8D%95%EF%BC%89"><span class="nav-number">6.1.</span> <span class="nav-text">基本表单（垂直表单）</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E5%86%85%E8%81%94%E8%A1%A8%E5%8D%95"><span class="nav-number">6.2.</span> <span class="nav-text">内联表单</span></a><ol class="nav-child"><li class="nav-item nav-level-4"><a class="nav-link" href="#%E6%B3%A8%E6%84%8F"><span class="nav-number">6.2.1.</span> <span class="nav-text">注意</span></a></li></ol></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E6%B0%B4%E5%B9%B3%E8%A1%A8%E5%8D%95"><span class="nav-number">6.3.</span> <span class="nav-text">水平表单</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E8%BE%93%E5%85%A5%E6%A1%86"><span class="nav-number">6.4.</span> <span class="nav-text">输入框</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E6%A0%87%E7%AD%BE"><span class="nav-number">6.5.</span> <span class="nav-text">标签</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E6%8C%89%E9%92%AE"><span class="nav-number">6.6.</span> <span class="nav-text">按钮</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#%E5%9B%BE%E7%89%87"><span class="nav-number">7.</span> <span class="nav-text">图片</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#%E8%BE%85%E5%8A%A9%E7%B1%BB"><span class="nav-number">8.</span> <span class="nav-text">辅助类</span></a></li></ol></div>
      </div>
      <!--/noindex-->

      <div class="site-overview-wrap sidebar-panel">
        <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
    <img class="site-author-image" itemprop="image" alt="幽辰"
      src="/hexo/images/avatar.jpg">
  <p class="site-author-name" itemprop="name">幽辰</p>
  <div class="site-description" itemprop="description"></div>
</div>
<div class="site-state-wrap motion-element">
  <nav class="site-state">
      <div class="site-state-item site-state-posts">
          <a href="/hexo/archives/">
        
          <span class="site-state-item-count">127</span>
          <span class="site-state-item-name">posts</span>
        </a>
      </div>
      <div class="site-state-item site-state-categories">
            <a href="/hexo/categories/">
          
        <span class="site-state-item-count">14</span>
        <span class="site-state-item-name">categories</span></a>
      </div>
      <div class="site-state-item site-state-tags">
            <a href="/hexo/tags/">
          
        <span class="site-state-item-count">23</span>
        <span class="site-state-item-name">tags</span></a>
      </div>
  </nav>
</div>



      </div>

    </div>
  </aside>
  <div id="sidebar-dimmer"></div>


      </div>
    </main>

    <footer class="footer">
      <div class="footer-inner">
        

        

<div class="copyright">
  
  &copy; 
  <span itemprop="copyrightYear">2021</span>
  <span class="with-love">
    <i class="fa fa-heart"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">幽辰</span>
</div>
  <div class="powered-by">Powered by <a href="https://hexo.io/" class="theme-link" rel="noopener" target="_blank">Hexo</a> & <a href="https://theme-next.org/" class="theme-link" rel="noopener" target="_blank">NexT.Gemini</a>
  </div>

        








      </div>
    </footer>
  </div>

  
  <script src="/hexo/lib/anime.min.js"></script>
  <script src="/hexo/lib/velocity/velocity.min.js"></script>
  <script src="/hexo/lib/velocity/velocity.ui.min.js"></script>

<script src="/hexo/js/utils.js"></script>

<script src="/hexo/js/motion.js"></script>


<script src="/hexo/js/schemes/pisces.js"></script>


<script src="/hexo/js/next-boot.js"></script>




  















  

  

</body>
</html>
